Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added scale-metric flag to configure metric name #1653

Merged
merged 5 commits into from
Apr 18, 2022

Conversation

vyasgun
Copy link
Contributor

@vyasgun vyasgun commented Apr 13, 2022

Description

Added --scale-metric flag to configure the metric name

Changes

  • Added flag
  • Added unit test
  • Validation already present in serving

Reference

Fixes #1205

Copy link

@knative-prow knative-prow bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vyasgun: 0 warnings.

In response to this:

Description

Added --scale-metric flag to configure the metric name

Changes

  • Added flag
  • Added unit test
  • Validation already present in serving

Reference

Fixes #1205

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow knative-prow bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 13, 2022
@codecov
Copy link

codecov bot commented Apr 13, 2022

Codecov Report

Merging #1653 (11669b2) into main (76f17f6) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head 11669b2 differs from pull request most recent head b7dde26. Consider uploading reports for the commit b7dde26 to get more accurate results

@@            Coverage Diff             @@
##             main    #1653      +/-   ##
==========================================
+ Coverage   79.30%   79.32%   +0.02%     
==========================================
  Files         171      171              
  Lines       12925    12939      +14     
==========================================
+ Hits        10250    10264      +14     
  Misses       1955     1955              
  Partials      720      720              
Impacted Files Coverage Δ
...kg/kn/commands/service/configuration_edit_flags.go 82.96% <100.00%> (+0.43%) ⬆️
pkg/serving/config_changes.go 96.74% <100.00%> (+0.13%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76f17f6...b7dde26. Read the comment docs.

@@ -93,6 +94,9 @@ func (p *ConfigurationEditFlags) addSharedFlags(command *cobra.Command) {
command.Flags().IntVar(&p.MaxScale, "scale-max", 0, "Maximum number of replicas.")
p.markFlagMakesRevision("scale-max")

command.Flags().StringVar(&p.ScaleMetric, "scale-metric", "", "Metric the PodAutoscaler should scale on.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a few examples here, like rps or concurrency maybe? Just for better illustration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdyt? I'd like to highlight it's "name": Name of metric to scale on by the PodAutoscaler.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a subjective nit, otherwise OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I just updated the flag usage. I also updated the usage for --scale-target flag. Does it read better now?

@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 14, 2022
@vyasgun vyasgun force-pushed the pr/metric-type branch 2 times, most recently from 11669b2 to b7dde26 Compare April 17, 2022 19:42
@dsimansk
Copy link
Contributor

Thanks!

/approve
/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Apr 18, 2022
@knative-prow
Copy link

knative-prow bot commented Apr 18, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, vyasgun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 18, 2022
@knative-prow knative-prow bot merged commit bb055ee into knative:main Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support to allow scaling metric type (concurrency, rps, cpu, memory)
2 participants